<form (ngSubmit)="addArticle()">
  <div class="row">
    <div class="form-group">
      <label class="col-xs-3">标题:</label>
      <div class="col-xs-12 input-group">
        <input type="text"
               [(ngModel)]="articleData.title"
               name="title"
               class="form-control">
      </div>
    </div>
    <div class="form-group">
      <label class="col-xs-3">描述:</label>
      <div class="col-xs-12 input-group">
        <input type="text"
               [(ngModel)]="articleData.contentDesc"
               name="contentDesc"
               class="form-control">
      </div>
    </div>

    <div class="button-container">
      <label class="btn btn-primary">
        <input type="file"
               class="hidden"
               ngFileSelect
               [options]="options"
               [events]="inputUploadEvents"
               (onUpload)="handleUpload($event)"
               (onPreviewData)="handlePreviewData($event)"
               (beforeUpload)="beforeUpload($event)">
        上传图片
      </label>
    </div>

    <div *ngIf="previewData" class="col-xs-12">
      <img [src]="previewData" class="imgPerview">
    </div>

    <div class="form-group">
      <label class="col-xs-3">分类:</label>
      <div class="col-xs-12 input-group">
        <select class="form-control" name="tabId" [(ngModel)]="tabId">
            <option *ngFor="let tab of articleTabs" [ngValue]="tab._id">
                {{ tab.tabName }}
            </option>
        </select>
      </div>
    </div>

    <div class="form-group">
      <label class="col-xs-3">正文:</label>
      <div class="col-xs-12 input-group">
        <textarea type="text"
                  [(ngModel)]="articleData.content"
                  name="content"
                  class="form-control content"></textarea>
      </div>
    </div>
    <div class="form-group btn-wrap clearfix">
      <div class="col-xs-12 text-center">
        <button type="submit" class="btn btn-primary submit">提交</button>
        <button class="btn btn-danger" (click)="goBack()">取消</button>
      </div>
    </div>
  </div>
</form>
